<?php

/*
|--------------------------------------------------------------------------
| System Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your module. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/
//系统模块路由
Route::group(['prefix'=>'admin','middleware' => 'auth.admin:admin'],function (){
    //图标管理
    Route::group(['prefix' => 'icon'], function(){
        Route::get('/','IconController@index')->name('admin.icon');//图标列表
        Route::get('getList','IconController@getList')->name('admin.icon.getList');
        Route::get('create', 'IconController@create')->name('admin.icon.create');
        Route::post('store', 'IconController@store')->name('admin.icon.store');
        Route::put('update', 'IconController@update')->name('admin.icon.update');
    });
    // 权限管理
    Route::group(['prefix' => 'permission'], function(){
        Route::get('/','PermissionController@index')->name('admin.permission');//权限列表
        Route::get('getList','PermissionController@getList')->name('admin.permission.getList');//获取权限列表
        Route::get('create', 'PermissionController@create')->name('admin.permission.create');
        Route::post('store', 'PermissionController@store')->name('admin.permission.store');
        Route::get('{id}/edit', 'PermissionController@edit')->name('admin.permission.edit');
        Route::put('{id}/update', 'PermissionController@update')->name('admin.permission.update');
        Route::delete('destroy', 'PermissionController@destroy')->name('admin.permission.destroy');
    });
    //角色管理
    Route::group(['prefix' => 'role'], function() {
        Route::get('/', 'RoleController@index')->name('admin.role');
        Route::get('getList','RoleController@getList')->name('admin.role.getList');
        Route::get('create', 'RoleController@create')->name('admin.role.create');
        Route::post('store', 'RoleController@store')->name('admin.role.store');
        Route::delete('destroy', 'RoleController@destroy')->name('admin.role.destroy');
        Route::get('{id}/edit', 'RoleController@edit')->name('admin.role.edit');
        Route::put('{id}/update', 'RoleController@update')->name('admin.role.update');
        Route::get('{id}/permission', 'RoleController@permission')->name('admin.role.permission');
        Route::put('{id}/assignPermission', 'RoleController@assignPermission')->name('admin.role.assignPermission');
    });
    //管理员列表
    Route::group(['prefix' => 'user'], function() {
        Route::get('/', 'UserController@index')->name('admin.user');
        Route::get('getList','UserController@getList')->name('admin.user.getList');
        Route::delete('destroy', 'UserController@destroy')->name('admin.user.destroy');
        Route::get('create', 'UserController@create')->name('admin.user.create');
        Route::post('store', 'UserController@store')->name('admin.user.store');
        Route::get('{id}/edit', 'UserController@edit')->name('admin.user.edit');
        Route::put('{id}/update', 'UserController@update')->name('admin.user.update');
        Route::get('{id}/role', 'UserController@role')->name('admin.user.role');
        Route::put('{id}/assignRole', 'UserController@assignRole')->name('admin.user.assignRole');
        Route::get('{id}/permission', 'UserController@permission')->name('admin.user.permission');
        Route::put('{id}/assignPermission', 'UserController@assignPermission')->name('admin.user.assignPermission');
    });
    //配置管理
    Route::group(['prefix' => 'config'], function() {
        Route::get('/', 'ConfigController@index')->name('admin.config');
        Route::get('create', 'ConfigController@create')->name('admin.config.create');
        Route::post('update', 'ConfigController@update')->name('admin.config.update');
        Route::post('store', 'ConfigController@store')->name('admin.config.store');
        Route::post('delImage', 'ConfigController@delImage')->name('admin.config.delImage');
        Route::post('typeStore', 'ConfigController@typeStore')->name('admin.config.typeStore');
        Route::get('list', 'ConfigController@list')->name('admin.config.list');
        Route::delete('destroy', 'ConfigController@destroy')->name('admin.config.destroy');
        Route::get('{id}/edit', 'ConfigController@edit')->name('admin.config.edit');
        Route::get('getList','ConfigController@getList')->name('admin.config.getList');
        Route::post('editSort','ConfigController@editSort')->name('admin.config.editSort');
        Route::post('editData','ConfigController@editData')->name('admin.config.editData');
    });

});



